package com.tr1701_demo.controller.goods;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.tr1701_demo.moder.dao.shop_val;
import com.tr1701_demo.moder.entitys.xiang_entity;

/**
 * Servlet implementation class all_img
 */
@WebServlet("/shangpin")
public class all_img extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public all_img() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
					List<xiang_entity> list = new shop_val().all("20H3A004CD");
					List<xiang_entity> list2 = new shop_val().allx_name();
					System.out.println("3333");

					if(list.size()>0){
						request.setAttribute("img", list);
						System.out.println("33");
					}
					if(list2.size()>0){
						request.setAttribute("list2", list2);
					}
					request.getRequestDispatcher("/jsps/shangpin.jsp").forward(request, response);

	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
